package czy.demo.runner;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import java.util.Arrays;

/* Runner启动前运行run方法，一般再Started和Ready事件之间调用 */
@Component
public class SpringApplicationRunner implements ApplicationRunner {

    private static final Logger logger = LoggerFactory.getLogger(SpringApplicationRunner.class);

    @Override
    public void run(ApplicationArguments args) throws Exception {
        logger.info("运行SpringApplicationRunner："+ Arrays.toString(args.getSourceArgs()));
    }
}
